bosfore_app.controller('promotionController',function ($scope,promotionService) {
     $scope.page = 1
     $scope.size = 10


    $scope.initialize=function () {
      $scope.pageQuery(1)
    }


    $scope.pageQuery = function(page){
         //判断当前页码不能为0一下
         if (page<=0){
             return;
         }
         if (page >= $scope.pages){
             return;
         }
         //异步请求先
        promotionService.pageQuery(page,$scope.size).success(
            function (data) {
                //当前页数需加1
                 $scope.currentlyPages = data.currentlyPages;
                 $scope.currentlyPages++
                 //总记录数
                $scope.totalElements = data.totalElements;
                //总页数
                $scope.pages = data.pages;
                //数据
                $scope.queryList = data.queryList;

            }
        )
    }
    $scope.prev=function (value) {
        $scope.pageQuery(value)
    }
    $scope.next=function (value) {
        $scope.pageQuery(value)
    }
})